const webpack = require('webpack');

module.exports = {
  webpack: {
    configure: (webpackConfig) => {
      webpackConfig.resolve.fallback = {
        ...webpackConfig.resolve.fallback, // 如果已有其他 fallback 设置，则保留它们
        "http": require.resolve('stream-http'),
        "https": require.resolve('https-browserify'),
        "path": require.resolve("path-browserify"),
        "buffer": require.resolve("buffer/"),
        "querystring": require.resolve("querystring-es3"),
        "zlib": require.resolve("browserify-zlib"),
      };
      return webpackConfig;
    },
  },
};